import request from '@/utils/request'

// 查询客户信息列表
export function listCustomer(query) {
  return request({
    url: '/member/customer/list',
    method: 'post',
    data: query
  })
}

// 查询客户信息详细
export function getCustomer(id) {
  return request({
    url: '/member/customer/' + id,
    method: 'get'
  })
}

// 新增客户信息
export function addCustomer(data) {
  return request({
    url: '/member/customer/add',
    method: 'post',
    data: data
  })
}

// 修改客户信息
export function updateCustomer(data) {
  return request({
    url: '/member/customer/update',
    method: 'post',
    data: data
  })
}

// 删除客户信息
export function delCustomer(id) {
  return request({
    url: '/member/customer/delete/' + id,
    method: 'post'
  })
}

//设置客户为供应商
export function setSupplier(id){
  return request({
    url: '/member/customer/setSupplier/' + id,
    method: 'post'
  })
}

//设置客户结算日期
export function updateSettleDate(data){
  return request({
    url: '/member/customer/updateSettleDate',
    method: 'post',
    data: data
  })
}

// 查询客户结算信息列表
export function listSettleCustomer(query) {
  return request({
    url: '/member/customer/listSettle',
    method: 'post',
    data: query
  })
}

export function preAudit(id){
  return request({
    url: '/member/customer/preAudit/' + id,
    method: 'post'
  })
}

export function preAuditCancel(id){
  return request({
    url: '/member/customer/preAuditCancel/' + id,
    method: 'post'
  })
}

export function reAudit(id){
  return request({
    url: '/member/customer/reAudit/' + id,
    method: 'post'
  })
}

export function reAuditCancel(id){
  return request({
    url: '/member/customer/reAuditCancel/' + id,
    method: 'post'
  })
}